<?php defined('BASEPATH') OR exit('No direct script access allowed');
/*
 * author  : hatran
 * email   : ha.tran@citigovietnam.com
 * version : 1.0
 * */

  
class Home_model extends Model {
    
	var $table			=	"menu";
	var $news_table		=	"news";
	
    function __construct(){
        parent::__construct();
        
    }
    
	
    
    
    
    function get_content_home_top(){
    	$res 			= 		$this->db->where('on_home_top', 'yes')
    								 	 ->order_by('name', 'ASC')
    								 	 ->limit(4)
    								 	 ->get($this->table)
    								 	 ->result();
    					
    	return $res;				
    }
    
    
    
    
    
    
	function get_content_home_bottom(){
    	$res 			= 		$this->db->where('on_home_bottom', 'yes')
    							   		 ->order_by('name', 'ASC')
    									 ->limit(3)
    									 ->get($this->table)
    									 ->result();
    					
    	return $res;				
    }
    
    
    
    
    function get_hit_news(){
    	$res 			=		$this->db->where('hits','yes')
    									 ->order_by('name', 'ASC')
    									 ->limit(5)
    									 ->get($this->news_table)
    									 ->result();
    									 
    	return $res;
    }
}
